import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';

class Saved extends StatelessWidget {
  final Set<WordPair> saved;
  final String title;

  const Saved({Key key, this.saved, this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final tiles = saved.map((pair) {
      return new ListTile(
          title: new Text(pair.asPascalCase,
              style: new TextStyle(fontSize: 18.0)));
    });
    final divided =
        ListTile.divideTiles(tiles: tiles, context: context).toList();
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(title),
      ),
      body: new ListView(
        children: divided,
      ),
    );
  }
}
